package cn.wolfcode.shop.cloud.util;

import cn.wolfcode.shop.cloud.key.KeyPrefix;

public class SeckillKeyPrefix implements KeyPrefix {
    //获取过期时间
    private int expireTime;
    //获取前缀
    private String keyPrefix;

    public SeckillKeyPrefix(int expireTime, String keyPrefix) {
        this.expireTime = expireTime;
        this.keyPrefix = keyPrefix;
    }

    public SeckillKeyPrefix() {
    }

    @Override
    public int getExpireTime() {
        return this.expireTime;
    }

    @Override
    public String getKeyPrefix()
    {
        return this.keyPrefix;
    }

    //在redis中将expireTime这个值设置为01,及不设置过期时间
    public static final SeckillKeyPrefix SECKILL_STOCK_COUNT = new SeckillKeyPrefix(0, "stock_count:");

    public static final SeckillKeyPrefix SECKILL_ORDER=new SeckillKeyPrefix(0,"seckill_order:");

    public static final SeckillKeyPrefix SECKILL_HASH=new SeckillKeyPrefix(0,"seckill_hash");

    public static final SeckillKeyPrefix SECKILL_PATH=new SeckillKeyPrefix(5,"seckill_path");

    public static final SeckillKeyPrefix SECKILL_VERIFY_CODE_RESULT=new SeckillKeyPrefix(60,"seckill_verify_code_result");

}
